﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic" xmlns:Microsoft_Windows_Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna">
	
	<!-- Resource dictionary entries should be defined here. -->
	<ResourceDictionary.MergedDictionaries>
  		<ResourceDictionary Source="Brushes.xaml" />
    </ResourceDictionary.MergedDictionaries>
	
	<Style x:Key="ComboBoxFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="4,4,21,4"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<Style x:Key="ComboBoxTransparentButtonStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="Width" Value="Auto"/>
		<Setter Property="Height" Value="Auto"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="ClickMode" Value="Press"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Grid SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton"/>
						</Grid.ColumnDefinitions>
						<Microsoft_Windows_Themes1:ScrollChrome x:Name="Chrome" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Grid.Column="1" HasOuterBorder="false" Padding="1,0,0,0" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsChecked}" Microsoft_Windows_Themes1:ScrollChrome.ScrollGlyph="DownArrow" ThemeColor="NormalColor"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<ScrollViewer Focusable="false" x:Name="PART_ContentHost" Background="Transparent" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
		<Grid SnapsToDevicePixels="true">
			<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
				<Grid Grid.IsSharedSizeScope="true">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="1"/>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton"/>
					</Grid.ColumnDefinitions>
					<TextBox Margin="{TemplateBinding Padding}" x:Name="PART_EditableTextBox" Style="{StaticResource ComboBoxEditableTextBox}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" IsReadOnly="{Binding Path=IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"/>
					<ToggleButton Style="{StaticResource ComboBoxTransparentButtonStyle}" Background="{x:Null}" Grid.ColumnSpan="3" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
				</Grid>
			</Border>
			<Popup Focusable="false" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" x:Name="PART_Popup">
				<Microsoft_Windows_Themes1:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="Shdw" Color="Transparent">
					<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
						<ScrollViewer>
							<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
						</ScrollViewer>
					</Border>
				</Microsoft_Windows_Themes1:SystemDropShadowChrome>
			</Popup>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="HasItems" Value="false">
				<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
				<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
			</Trigger>
			<Trigger Property="IsGrouping" Value="true">
				<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
			</Trigger>
			<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
				<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
				<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ComboBox}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ComboBox}">
					<Grid SnapsToDevicePixels="true">
						<Border x:Name="Bd" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<Grid Grid.IsSharedSizeScope="true">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="1"/>
									<ColumnDefinition Width="*"/>
									<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton"/>
								</Grid.ColumnDefinitions>
								<Border Margin="{TemplateBinding Padding}" x:Name="SelectedItemBorder" Grid.ColumnSpan="2"/>
								<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
								<ToggleButton Style="{StaticResource ComboBoxTransparentButtonStyle}" Grid.ColumnSpan="3" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
							</Grid>
						</Border>
						<Popup Focusable="false" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" x:Name="PART_Popup">
							<Microsoft_Windows_Themes1:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="Shdw" Color="Transparent" Height="Auto">
								<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
									<ScrollViewer>
										<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" Height="Auto"/>
									</ScrollViewer>
								</Border>
							</Microsoft_Windows_Themes1:SystemDropShadowChrome>
						</Popup>
					</Grid>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelectionBoxHighlighted" Value="true"/>
								<Condition Property="IsDropDownOpen" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsSelectionBoxHighlighted" Value="True">
							
						</Trigger>
						<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
							<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
							<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
						</Trigger>
						<Trigger Property="HasItems" Value="false">
							<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="IsEditable" Value="true">
				<Setter Property="IsTabStop" Value="false"/>
				<Setter Property="Padding" Value="0,1"/>
				<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<Style x:Key="ComboBoxCheckBoxStyle" TargetType="{x:Type ComboBox}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ComboBox}">
					<Grid SnapsToDevicePixels="true">
						<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
							<Grid Grid.IsSharedSizeScope="true">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="1"/>
									<ColumnDefinition Width="*"/>
									<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton"/>
								</Grid.ColumnDefinitions>
								<Border Margin="{TemplateBinding Padding}" x:Name="SelectedItemBorder" Grid.ColumnSpan="2"/>
								<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
								<ToggleButton Style="{StaticResource ComboBoxTransparentButtonStyle}" Grid.ColumnSpan="3" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
							</Grid>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelectionBoxHighlighted" Value="true"/>
								<Condition Property="IsDropDownOpen" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsSelectionBoxHighlighted" Value="True"/>
						<Trigger Property="HasItems" Value="false"/>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="IsEditable" Value="true">
				<Setter Property="IsTabStop" Value="false"/>
				<Setter Property="Padding" Value="0,1"/>
				<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
			</Trigger>
		</Style.Triggers>
	</Style>
	<Style x:Key="AppointmentComboBoxStyle" TargetType="{x:Type ComboBox}">
		<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
		<Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Padding" Value="1"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ComboBox}">
					<Grid SnapsToDevicePixels="true" Background="#FFFFFFFF">
						<Border x:Name="Bd" Padding="1" Background="{x:Null}" BorderBrush="{DynamicResource LightBlueFontBrush}" BorderThickness="1,1,1,1" CornerRadius="0,0,0,0">
							<Grid Grid.IsSharedSizeScope="true">
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="1"/>
									<ColumnDefinition Width="*"/>
									<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton"/>
								</Grid.ColumnDefinitions>
								<Border Margin="{TemplateBinding Padding}" x:Name="SelectedItemBorder" Grid.ColumnSpan="2"/>
								<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
								<ToggleButton Style="{StaticResource ComboBoxTransparentButtonStyle}" Grid.ColumnSpan="3" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
							</Grid>
						</Border>
						<Popup Focusable="false" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" x:Name="PART_Popup">
							<Microsoft_Windows_Themes1:SystemDropShadowChrome MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="Shdw" Color="Transparent" Height="Auto">
								<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource LightBlueFontBrush}" BorderThickness="1,0,1,1">
									<ScrollViewer>
										<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" Height="Auto"/>
									</ScrollViewer>
								</Border>
							</Microsoft_Windows_Themes1:SystemDropShadowChrome>
						</Popup>
					</Grid>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelectionBoxHighlighted" Value="true"/>
								<Condition Property="IsDropDownOpen" Value="false"/>
							</MultiTrigger.Conditions>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsSelectionBoxHighlighted" Value="True"/>
						<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
							<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
							<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
						</Trigger>
						<Trigger Property="HasItems" Value="false">
							<Setter Property="MinHeight" TargetName="DropDownBorder" Value="95"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
						</Trigger>
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="IsEditable" Value="true">
				<Setter Property="IsTabStop" Value="false"/>
				<Setter Property="Padding" Value="0,1"/>
				<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
			</Trigger>
		</Style.Triggers>
	</Style>
	
</ResourceDictionary>